<template>
    <div>
      {{childData}}
      <el-form :inline="true" :model="searchForm" size="mini">
        <div class="common-btn">
          <el-button type="success" size="mini" @click="getExcel">导出excel</el-button>
          <el-button type="success" size="mini" @click="refundMoney">退款</el-button>
          <el-button type="success" size="mini" @click="settleCommission">结算</el-button>
          <el-button type="success" size="mini" @click="endCourse">结束课程</el-button>
          <el-button type="success" size="mini" @click="cancelCourse">取消课程</el-button>
          <el-button type="success" size="mini" @click="importingUsers">导入用户</el-button>
        </div>
        <div class="search-common">
          <el-row :gutter="10">
            <el-col :sm="8" :xs="24" >
              <el-form-item>
                <el-input placeholder="请输入内容" v-model="searchForm.userType" class="input-with-select">
                  <el-select v-model="searchForm.currentUserType" style="width: 120px;" slot="prepend" placeholder="请选择">
                    <el-option label="讲师姓名" value="0"></el-option>
                    <el-option label="讲师昵称" value="1"></el-option>
                    <el-option label="用户手机" value="2"></el-option>
                    <el-option label="课程ID" value="3"></el-option>
                    <el-option label="讲师ID" value="4"></el-option>
                  </el-select>
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :sm="8" :xs="24" >
              <div class="grid-content bg-purple">
                <el-form-item label="课程状态" label-width="70px">
                  <el-select  placeholder="" v-model="searchForm.courseType" style="width:180px">
                    <el-option label="全部" value=""></el-option>
                    <el-option label="未开始" value="0"></el-option>
                    <el-option label="正在执行" value="1"></el-option>
                    <el-option label="课程完成" value="2"></el-option>
                    <el-option label="断线取消" value="3"></el-option>
                    <el-option label="超时取消" value="4"></el-option>
                    <el-option label="未开课取消" value="5"></el-option>
                    <el-option label="断线完成" value="6"></el-option>
                    <el-option label="超时完成" value="7"></el-option>
                    <el-option label="系统结束" value="8"></el-option>
                    <el-option label="系统取消" value="9"></el-option>
                  </el-select>
                </el-form-item>
              </div>
            </el-col>
            <el-col :sm="8" :xs="24" >
              <el-form-item label="经纪商" label-width="70px">
                <el-select placeholder="经纪商" v-model="searchForm.mate" style="width:180px">
                  <el-option label="全部" value=""></el-option>
                  <el-option label="睿汇" value="1"></el-option>
                  <el-option label="富徳" value="2"></el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row :gutter="10">
            <el-col :sm="8" :xs="24">
              <el-form-item label="跟单金额" >
                <el-input-number v-model="searchForm.startAmountSum" controls-position="right"  style="width:80px"    :min="1" :max="9999999"></el-input-number>
                至 <el-input-number   v-model="searchForm.endAmountSum" controls-position="right" style="width:80px"   :min="1" :max="9999999"></el-input-number>
              </el-form-item>
            </el-col>
            <el-col :sm="8" :xs="24">
              <el-form-item label="课程单价" >
                <el-input-number v-model="searchForm.startCoursePrice" controls-position="right"  style="width:80px"    :min="1" :max="9999999"></el-input-number>
                至 <el-input-number v-model="searchForm.endCoursePrice" controls-position="right" style="width:80px"   :min="1" :max="9999999"></el-input-number>
              </el-form-item>
            </el-col>
            <el-col :sm="8" :xs="24">
              <el-form-item label="跟单人次" >
                <el-input-number v-model="searchForm.startPassengers" controls-position="right"  style="width:80px"    :min="1" :max="9999999"></el-input-number>
                至 <el-input-number   v-model="searchForm.endPassengers" controls-position="right" style="width:80px"   :min="1" :max="9999999"></el-input-number>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row :gutter="10">
            <el-col :sm="8" :xs="24" >
              <div class="grid-content bg-purple-light">
                <el-form-item label="结算状态">
                  <el-select placeholder="结算状态" v-model="searchForm.settlementState" style="width:180px">
                    <el-option label="全部"  value=""></el-option>
                    <el-option label="结算中" value="1"></el-option>
                    <el-option label="未结算" value="2"></el-option>
                    <el-option label="已结算" value="3"></el-option>
                  </el-select>
                </el-form-item>
              </div>
            </el-col>
            <el-col :sm="8" :xs="24">
              <el-form-item label="盈亏金额" >
                <el-input-number v-model="searchForm.startProfitLoss" controls-position="right"  style="width:80px"    :min="1" :max="9999999"></el-input-number>
                至 <el-input-number   v-model="searchForm.endProfitLoss" controls-position="right" style="width:80px"   :min="1" :max="9999999"></el-input-number>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row :gutter="10">
            <el-col :sm="24" :xs="24">
              <el-form-item label="开课时间" >
                <el-date-picker
                  v-model="searchForm.openingTime"
                  type="daterange"
                  value-format="yyyy-MM-dd"
                  range-separator="至"
                  start-placeholder="开始日期"
                  end-placeholder="结束日期">
                </el-date-picker>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row :gutter="10">
            <el-col :sm="8" :lg="6" :xs="24" >
              <el-form-item>
                <el-button type="primary" @click="submitForm">查询</el-button>
                <el-button type="info">重置</el-button>
              </el-form-item>
            </el-col>
          </el-row>
        </div>
      </el-form>
      <!--弹窗-->
      <common-dialog title="" width="40%" :base-dialog="dialogFormVisible">
        <div slot="body">
          <div class="mt10">

          </div>
          <div class="tc mt20">
            <el-button @click="dialogFormVisible=false" size="medium">取消</el-button>
            <el-button type="primary" size="medium" @click="">确定</el-button>
          </div>
        </div>
      </common-dialog>
      <!--弹窗-->
    </div>
</template>

      <script>
        import commonDialog from "@/components/Common/CommonDialog";
          export default {
            data() {
                return {
                  dialogFormVisible:false,
                  searchForm:{
                    userType:'',
                    currentUserType:'0',
                    courseType:'',
                    mate:'',
                    settlementState:'',
                    startCoursePrice:'',
                    endCoursePrice:'',
                    startPassengers:'',
                    endPassengers:'',
                    startAmountSum:'',
                    endAmountSum:'',
                    startProfitLoss:'',
                    endProfitLoss:'',
                    openingTime:'',
                    startOpeningTime:'',
                    endOpeningTime:''
                  },
                };
            },
            props: ['childData'],
            mounted() {

            },
            methods: {
              submitForm(){
                //与父组件通信传值
                if(this.searchForm.orderTime === null){
                  this.searchForm.startTime = '';
                  this.searchForm.endTime = '';
                }else {
                  this.searchForm.startTime = this.searchForm.orderTime[0];
                  this.searchForm.endTime = this.searchForm.orderTime[1];
                }
                this.$emit('searchParams', this.searchForm);
                //console.log(JSON.stringify(this.searchForm,'--------'));
              },
              getExcel(){
                //根据筛选条件导出当前条件下所有数据
              },
              refundMoney(){
                //退款
              },
              settleCommission(){
                //结算
              },
              endCourse(){
                //结束课程
              },
              cancelCourse(){
                //取消课程
              },
              importingUsers(){
                //导入用户
              }
            },
            components:{
              commonDialog
            }
          };
      </script>
      <style scoped></style>
